Initial implementation of closed-form solution