a bunch of code from entries display, not working yet