Cleaned up javascript, removed trailing code.