removed unnecessary curly brackets
added support for 'function' properties