Errors fixed, ready for UI implementation