works. needs error handling and code cleaning