changed to enum return codes
added copyright notice