Time-based LP functioning, needs cleanup