Changed definition of theta so it can take on multple values