BUG Fixed schema error. Made code more user readable