added usage and reorganized variables slightly