Changed Logic and Syntax