no big changes, moved code around a bit