added some more code, still broken