Updated documentation + cleaned up hal code a little