complete re-write and added categories