Re-factored BASIC functions
Updates to specs