Fixed coding style and added copyright