Code completed

Pre-debugging, pre-compilation version