Cleaned up js script