added documentation, program functionable