complete rewrite.....