reformatted templated for easy removal of unneded white lines, added logic vars to the top