Debugged for #1

Still need to fix solver a bit