Finished advanced javascript