Motherfucker! Finally it works, although most of the stuff is hardcoded..