added max y equations