css fixes and finished algorithm