pseudocode formatted + remarks