updated with a later version. Made some local changes for testing with.