Bug fixes. Removed hardcoded variables, now it uses ON template info