modified library to be less complex