Cleaned Up JavaScript