Debugged functions; implemented ternary conditional operator (issue #5)