The searching for functions kind of works now... really messy