Cleaned up use of substring$