changed to use ggplot and made type corrections