Business logic

Simple business logic is finished.