added time implementation (still needs cleaned up around edges)