Added new base template and worked a lot on logic