Finished Design -> following is javascript