updated pseudo/real code