Added solution spec and a few bugs