rewrote and refactored
fixed html