Cleaned up code; add 24h check