complete rewrite, prepping for server app