added all existing template and functionality