put and get implemented. factorial written