Improved compilation system for functions
Broke Solve into building blocks
Small possible optimization