cleaned up old code and made work on other machines