finished most of logic. Some CSS corrections