clean-up code, carried out figures to <style> and also generate method to prototype object