added max limits and debugged orders