Cleaned code a bit, started with stability analysis