re-organized but still needs final tests at time