Specs are now working by adding a sleep timer. Cleaned up code a little more.