ugly code but it gives an idea of the usability of it