Modified to run in linux. Removed some stuff for testing