adding theta as a parameter