added support for multiple equations