Changed from library to ino, fixed bugs