Reverted to original script, cleaned up parser