A working piece of code. need to clean and edit readme