begining to work on the main module. it's mainly a copy of the recieve from the example