refactored js code to include callbacks for eventlisteners, also refactored some css to lighten file size up a bit