refactoring to be usable by controller
compute basics working