Implemented first functional version