Added use of alpha channel, some bugs fixed